package day02;

public class DataTypeCastDemo {
    public static void main(String[] args) {
        //基本类型间转换
        /**
        int a = 10;
        double b = a;
        int c= (int)b;

        long d = 10;
        double e = 10 ;
        System.out.println(e); //10.0

        long f = 100000000000000000L;
        int g = (int)f; //溢出

        double h = 25.23;
        int i = (int)h; //25 精度丢失
        */

        //转换的两种规则
        byte b1 = 10;
        byte b2 = 5;
        byte b3 = (byte)(b1+b2);

        System.out.println('2'); //2
        System.out.println('2'+'3'); //101 '2':转换成int型的值为50，然后进行相加 输出整型
        System.out.println(2 + '3'); //53
        System.out.println(2+2); //4
    }
}
